<!DOCTYPE html>
<html>
<head>
    <include file="Public/head"/>
    <link href="__CSS__/weixin.css" rel="stylesheet" />
</head>
<body>
<div id="mcover" onClick="document.getElementById('mcover').style.display='';" style=""><img src="__IMG__/Home/tishi.png"></div>
<div class="ui-wrap">

    <h4 class="ui-info-Name">{$info.lord_name}</h4>

    <div class="ui-info-img">
        <img src="Uploads/{$info.lord_img|get_cover='path'}"/>
    </div>

    <div class="ui-info-tiled">
        <a href="javascript::"><span id="voet_num">{$info.voet_num}</span><small>票</small></a>
        <a href="{:U('Lord/rank')}"><span id="count">{$info.num}</span><small>名</small></a>
        <a href="javascript::"><span id="scan_num">{$info.scan_num}</span><small>次</small></a>
    </div>

    <div class="ui-info-btn">
        <a id="checkAjax"><span>投TA一票</span></a>
        <a id="onMenuShareTimeline"><span>帮TA拉票</span></a>
    </div>

    <div class="ui-info-det">
        <div class="ui-from-title">
            <span>详细资料</span>
        </div>

        <div class="ui-info-txt">
            <p><b>群主：</b><span><strong>{$info.user_name}</strong></span></p>
            <p><b>粉丝量：</b><span id="fans_num">{$info.fans_num}</span></p>
            <p><b>拉票宣言：</b><span>{$info.lord_manifesto}</span></p>
            <p>
                <b>群描述：</b><br />
                <span>{$info.content}</span>
            </p>
        </div>
        <input type="hidden" id="lord_id" value="{$info.lord_id}">
    </div>
    
    <!--s banner-2-->
    <div class="swiper-container swiper-container-2">
        <div class="swiper-wrapper">
            <div class="swiper-slide">
                <a href="http://m.jiabangougo.com/home.html">
                	<img src="__IMG__/Home/banner-02-1.jpg"/>
            	</a>
            </div>
            <div class="swiper-slide">
                <a href="javascript:;">
                	<img src="__IMG__/Home/banner-02-2.jpg"/>
            	</a>
            </div>
            <div class="swiper-slide">
                <a href="http://www.bd-tou.com/wap/index.php?ctl=deal&act=show&id=79#">
                	<img src="__IMG__/Home/banner-02-3.jpg"/>
            	</a>
            </div>
            <div class="swiper-slide">
                <a href="javascript:;">
                	<img src="__IMG__/Home/banner-02-4.jpg"/>
            	</a>
            </div>
        </div>
    </div><!--e banner-2-->

    <div class="ui-home-btn visibility">
        <a href="javascript:;" class="l"><i class="fa fa-commenting"></i></a>
        <a href="javascript:;" class="r">占位</a>
    </div>

    <div class="ui-home-btn show">
        <a href="{:U('Index/index')}" class="l"><i class="fa fa-home"></i></a>
        <eq name="info.openid" value="$Think.session.wx_user.openid">
        <a href="{:U('Lord/index?lord_id='.$info['lord_id'])}" class="r">修改信息</a>
        </eq>
    </div>
</div>
<script type="text/javascript">
    var mySwiper = new Swiper('.swiper-container-2',{speed:500,pagination : '.swiper-pagination-2',autoplay : 3000});
    wx.ready(function () {

        // 投票
        document.querySelector('#checkAjax').onclick = function () {
            var lord_id = $('#lord_id').val();
            $.ajax({
                url:"{:U('Lord/lord_voet')}",
                type:'post',
                data:{lord_id:lord_id},
                success:function(result){
                    if(result.status==1){
                        alert(result.msg);
                        $('#fans_num').text(result.fans_num);
                        $('#count').text(result.count);
                        $('#voet_num').text(result.voet_num);
                        $('#scan_num').text(result.scan_num);
                    }else{
                        alert(result.msg);
                    }
                }
            });
        };

        // 2.2 监听“分享到朋友圈”按钮点击、自定义分享内容及分享结果接口
        document.querySelector('#onMenuShareTimeline').onclick = function () {
            wx.onMenuShareTimeline({
                title: '{$all["title"]}',
                link: '{$all["url"]}',
                imgUrl: '{$all["imgUrl"]}',
/*                trigger: function (res) {
                    alert('用户点击分享到朋友圈');
                },*/
                success: function (res) {
                    alert('已分享');
                },
                cancel: function (res) {
                    alert('已取消');
                },
                fail: function (res) {
                    alert(JSON.stringify(res));
                }
            });
            document.getElementById('mcover').style.display='block';
            //alert('已注册获取“分享到朋友圈”状态事件');
        };
    });
</script>
</body>
</html>
